#include "mainwindow.h"
#include <stdio.h>
#include <iostream>
#include <QtGui>

using namespace std;

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent)
{
    edit = new QLineEdit;

//    edit->show();

//    DiagBox *dialog = new DiagBox;
    m_name = "default";

    createActions();
    createMenus();

    setWindowTitle(tr("Champ Select"));
    GetDialog()->show();
    cout << "bacon" << endl;


}

MainWindow::~MainWindow()
{


}

void MainWindow::createActions()
{
/*
    clickOK = new QAction(tr("Enter"), this);
    clickOK->setShortcut(tr("ENTER"));
    connect(clickOK, SIGNAL(triggered()), this, SLOT(CopyText(QString)));
*/
     clickCancel = new QAction(tr("Cancel"), this);
     clickCancel->setShortcut(tr("Esc"));
     connect(clickCancel, SIGNAL(triggered()), this, SLOT(CancelText()));


}

void MainWindow::createMenus()
{
}

QDialog *MainWindow::GetDialog()
{
  DiagBox *dialog = new DiagBox;
  dialog->setTextValue(m_name);
  connect(dialog, SIGNAL(textValueSelected(QString)),
          this, SLOT(CopyText(QString)));
  return dialog;
}
